<div class="fly-panel fly-signin">
  <div class="fly-panel-title">签到
    <i class="fly-mid"></i>
    <a href="javascript:;" class="fly-link" id="LAY_signinHelp">说明</a>
    <i class="fly-mid"></i>
    <a href="javascript:;" class="fly-link" id="LAY_signinTop">活跃榜
      <span class="layui-badge-dot"></span></a>
    {if condition="$sign.is_login"}
    <span class="fly-signin-days">已连续签到<cite>{$sign.num}</cite>天</span>
    {/if}
  </div>
  <div class="fly-panel-main fly-signin-main">


    {if condition="$sign.is_login &&$sign.is_sign"}
        <button class="layui-btn layui-btn-disabled">今日已签到</button>
    {else/}
          <button class="layui-btn layui-btn-danger" id="LAY_signin">今日签到</button>
    {/if}
    
    {if condition="$sign.is_login"}
    <span>可获得<cite>{$sign.kiss}</cite>飞吻</span>
    {/if}
  </div>
</div>

<script>
        
  layui.use(['jquery','layer'],function(){

    $ = layui.jquery;
    layer = layui.layer;

    $('#LAY_signin').click(function(event) {
        $.get('{:url('index/user/sign')}', function(data) {
          if(data.code==1){
             layer.msg(data.msg,function () {
                 location.reload();
             })
          }else{
            layer.msg(data.msg,function () {})
          }
        });
    });

  })

  
</script>